using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            bool prime =true ;
            if (num <2){
                prime = false; 
            }
            if (num == 2 || num == 3){
                prime = true;
            }
            else if (num % 6 != 1 && num % 6 != 5){
                prime = false;
            }
            int sqr = (int)Math.Sqrt(num);
            for (int i = 5; i <= sqr; i += 6){
                if (num % i == 0 || num % (i + 2) == 0)
                {
                    prime = false;
                }
            }
            Console.WriteLine(prime);
            Console.WriteLine("*********************************");
            string m = Console.ReadLine();
            int n = Convert.ToInt32(m);
            for (int i = 1; i <= n; i++) //打印行数
            {
                for (int j = 1; j <= n - i; j++) //每行打印的空白个数
                {
                    Console.Write(" ");
                }

                for (int j = 1; j <= 2 * i - 1; j++) //每行打印*的个数
                {
                    Console.Write("*");
                }
                Console.WriteLine(); //换行
            }
            Console.ReadLine();
        }
    }
}
